﻿using FastCloud.Base.Desgin;
using FastCloud.Extend.Entity;
using FastUtil.Data;
using System;
using System.Collections.Generic;
using System.Text;

namespace FastCloud.Extend.DB
{
    public class DB_Element : BaseDBML<Frame_Element>
    {
        public override void Insert(Frame_Element Entity)
        {
            if (string.IsNullOrEmpty(Entity.ElementGuid))
            {
                Entity.ElementGuid = GenerateUtil.GenerateUnitGuid();
            }
            Entity.IsPublic = (int)Base.Enum.ORG.IsPublic.不完全公开;
            Entity.AddDate = DateTime.Now;
            base.Insert(Entity);
        }

        public void UpdateElementPublic(string ElementGuid, int IsPublic)
        {
            Frame_Element Entity = SelectOne(ElementGuid);
            Entity.IsPublic = IsPublic;
            base.UpdateByID(Entity);
        }
    }
}
